cmake_minimum_required(VERSION 3.0)
project("TOOLS_FFMPEG")
set(APP_NAME "tool_ffmpeg")

# Find OpenCV package
find_package(OpenCV REQUIRED)
message("OpenCV_INCLUDE_DIRS:${OpenCV_INCLUDE_DIRS}")
message("OpenCV_LIBRARIES:${OpenCV_LIBRARIES}")
include_directories(${OpenCV_INCLUDE_DIRS})

link_directories(
    /opt/ffmpeg/lib
)

include_directories(
    src
    /opt/ffmpeg/include
)

file(GLOB SRC_FILES 
    src/*.cc
    src/ffmpeg/*.cc
)
message("SRC_FILES:${SRC_FILES}")
add_executable(${APP_NAME}
    ${SRC_FILES}
)

target_link_libraries(${APP_NAME} PRIVATE
    avformat avcodec swscale avutil avdevice swresample pthread x264 x265
    ${OpenCV_LIBRARIES}
)
